package com.xingkeduo.business.schedule.remote;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.xingkeduo.business.schedule.dto.ResponseMessage;
import com.xingkeduo.business.schedule.remote.feign.MarketingFeignService;

import lombok.extern.slf4j.Slf4j;

/**
 * 
* @ClassName: MarketingRemoteService
* @Description: 营销相关定时任务
* @author lixin
* @date May 30, 2019 3:11:51 PM
*
 */
@Slf4j
@Service
public class MarketingRemoteService {

    @Resource
    public MarketingFeignService marketingFeignService;
    /**
     * 用户券，卡3天到期推送。
     *
     * @return
     * @throws Exception 
     */
    public void pushExpirationReminderTask() throws Exception {
    	try {
    		ResponseMessage responseMessage = marketingFeignService.pushExpirationReminder();
    		log.info(" responseMessage:{}", JSON.toJSONString(responseMessage));
    	}catch (Exception e) {
    		log.info("MarketingRemoteService.pushExpirationReminderTask exception...");
			e.printStackTrace();
			throw new Exception();
		}
    }
    /**
     * 
    * @Title: expireAbolishCouponTask 
    * @Description: 用户券过期更新
    * @param @throws Exception    设定文件 
    * @return void    返回类型 
    * @throws 
    * @author lixin
    * @date Jun 21, 2019 5:58:58 PM
     */
    public void expireAbolishCouponTask() throws Exception {
    	try {
    		ResponseMessage responseMessage = marketingFeignService.expireAbolishCoupon();
    		log.info(" responseMessage:{}", JSON.toJSONString(responseMessage));
    	}catch (Exception e) {
    		log.info("MarketingRemoteService.expireAbolishCouponTask exception...");
			e.printStackTrace();
			throw new Exception();
		}
    }
    /**
     * 
    * @Title: expireAbolishCardTask 
    * @Description: 用户卡过期更新 
    * @param @throws Exception    设定文件 
    * @return void    返回类型 
    * @throws 
    * @author lixin
    * @date Jun 21, 2019 5:59:23 PM
     */
    public void expireAbolishCardTask() throws Exception {
    	try {
    		ResponseMessage responseMessage = marketingFeignService.expireAbolishCard();
    		log.info(" responseMessage:{}", JSON.toJSONString(responseMessage));
    	}catch (Exception e) {
    		log.info("MarketingRemoteService.expireAbolishCardTask exception...");
			e.printStackTrace();
			throw new Exception();
		}
    }

}
